package com.minelx.datamicroscope.querylanguage.data;

import java.util.List;
import java.util.Map;
import java.util.Objects;

public class CollectingKey {

	private final String join;

	private final Map<String, String> on;

	private final List<Condition> conditions;

	public CollectingKey(String join, Map<String, String> on, List<Condition> conditions) {
		this.join = join;
		this.on = on;
		this.conditions = conditions;
	}

	public String getJoin() {
		return join;
	}

	public Map<String, String> getOn() {
		return on;
	}

	public List<Condition> getConditions() {
		return conditions;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		CollectingKey that = (CollectingKey) o;
		return join.equals(that.join) && on.equals(that.on) && conditions.equals(that.conditions);
	}

	@Override
	public int hashCode() {
		return Objects.hash(join, on, conditions);
	}

	@Override
	public String toString() {
		return "CollectingKey{" +
				"join='" + join + '\'' +
				", on=" + on +
				", conditions=" + conditions +
				'}';
	}
}
